package com.blog.bean.domain;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.elasticsearch.annotations.Field;

import javax.persistence.Column;
import javax.persistence.Table;
import java.time.LocalDateTime;
import java.util.Date;

/**
 * @author 任浩
 * @version 1.0
 */

@Builder
@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName("user")
public class User {

    @TableField(value = "id")
    private Integer id;

    @TableField(value = "username")
    private String username;

    @TableField(value = "password")
    private String password;

    @TableField(value = "salt")
    private String salt; //验证码

    @TableField(value = "email")
    private String email;

    @TableField(value = "type")
    private Integer type; //0-普通用户; 1-超级管理员; 2-版主

    @TableField(value = "status")
    private Integer status; //'0-未激活; 1-已激活

    @TableField(value = "activation_code")
    private String activationCode;

    @TableField(value = "header_url")
    private String headerUrl;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField(value = "create_time")
    private LocalDateTime createTime; //用户创建时间

}
